[OSX] remove top level handle scope to prevent leak

See also 5bf120fa8c0fab7572969d7320320e28c3e5168d