Ensure require.main === module in workers

Fixes #9