allow server to disconnect safely

the trap function allows the WEBrick server to disconnect safely with CTRL+C