How do I prevent accessing a page with /node/37 directly when an alias has been set?
You don't want to deny access to it but simply redirect to the aliased URL.

That feature is provided by the Redirect module and there's also a core issue to make core do that automatically.