metadata_server_port is broken and cfn_helper has no tests

Adds test suite for metadata_server_port and fixes the behavior. Also eliminates the bare except.