Correct hidden.bs and shown.bs events firing too early in tooltip and popover

I notices that tooltip events `shown.bs.tooltip` and `hidden.bs.tooltip` fire to early, just after `show.bs.tooltip` and `hide.bs.tooltip`, not waiting for CSS transition to end.

Here's a JSBin illustrating the issue: http://jsbin.com/EcaBiSo/2/edit

Popover.js is also affected by this bug as it inherits from tooltip.

This PR corrects this issue.