How to check if the current page is the permalink page?

<?php
// 'current_screen' action fires after the current screen has been set
add_action( 'current_screen', 'my_check_current_screen' );

// $current_screen is WP_Screen object passed by the 'current_screen' action
function my_check_current_screen( $current_screen ) {

    // compare current screen ID to the string of your choice
    if( 'options-permalink' === $current_screen->id ) {
        echo 'I am on the "Permalink Settings" screen';
    }
}

You can check what you can play with using the 'current_screen' action instead of global $pagenow:

add_action( 'current_screen', 'my_print_current_screen_object' );

function my_print_current_screen_object( $current_screen ) {

    echo '<pre>';
    print_r( $current_screen );
    echo '</pre>';

}