Clean up and simplify getStrokeBounds() code.

Handling of bevel and miter joins can be merged nicely.