Work permits are to make sure you don't steal jobs from the locals. Working on your own project has nothing to do with that. So while it may be breaking the letter of the law, it's certainly not breaking the spirit of it. My point being, you shouldn't have ethical issues with it -- it's like driving 57 in a 55 zone.
I know people who have been deported for not having the right visa -- a phone call by an angry ex or housemate in every case. Nobody's going to report you to immigration unless you've seriously pissed someone off. So just don't piss people off. And worst-case scenario, you leave early.