This happens because you are just detaching the Visual Studio debugger from the running IIS/IIS Express instance. As soon as you detach the debugger, the request's execution continues on the webserver and thus, the rest of the code is executed.
A quick workaround would be to wrap your null return code in a compiler condition and check for the DEBUG symbol. Something along these lines:
#if DEBUG
return null;
#endif
Production code should be built using the RELEASE compiler symbol instead of the DEBUG symbol to enable deletion.