Fix "SyntaxError: Unexpected token try"

This happened when the user interrupted a hot swap with another hot swap, which caused the "close" event to be fired twice and thus the hot swapping code to be substituted in twice on the same file data.