Get ID of first image attached to a post

I assume all your code is wrapped inside the loop? And you should check that a post does indeed have attachments before operating on the $images array:

while ( have_posts() ) {
    the_post();

    if ( has_post_thumbnail() ) {
        the_post_thumbnail( /* No need for "post-thumbnail" argument, it's the default. */ ); 
    } else {
        // No post thumbnail, try attachments instead.
        $images = get_posts(
            array(
                'post_type'      => 'attachment',
                'post_mime_type' => 'image',
                'post_parent'    => $post->ID,
                'posts_per_page' => 1, /* Save memory, only need one */
            )
        );

        if ( $images ) {
            echo '<img src="' . wp_get_attachment_image_src( $images[0]->ID, 'post-thumbnail' ) . '" alt="" />';
        }
    }
}

Note that I’ve re-structured your code a little – there’s no need to burden the server and query for attachments if the post already has a thumbnail.