How to leave a postdoc prematurely without burning bridges?
Speaking as someone who has seen how disruptive unexpected departures can be to a project, earlier notice is almost always better for your advisor, and I think you are less likely to burn bridges if you 1) let them know as soon as possible, and 2) try to finish things up / leave them in a state where someone else can take over.  All this is probably similar to industry, except that the lead time is probably much longer (since it takes longer to be hired, usually).

The caveat here is that you have to make a call about your advisor's temper. If you think your advisor is a bitter or petty person who will dislike you for leaving under any circumstances, waiting until later might be your only option, because you will burn bridges either way, and you do not want to be abused for several months. This is a rare circumstance, and it doesn't sound like your case. 

Here's the other big point: unless you think there is something you can do to improve the environment which would make you stay (doesn't sound like there is), being too detailed about why you are leaving is only going to make people angrier. Saying "I don’t find the department to be a nice environment and I am doing menial work from which I don’t benefit" - whether or not it is true that your tasks are menial - will aggravate people, as you guessed. Saying, "I haven't found this line of research as exciting as I hoped" is probably enough, and (if you know) saying "I want to move more in the direction X" might be good.