Night buses are to return to Bournemouth and Poole after a break of more four years.