Efficient rejection-based simulation of biochemical reactions with stochastic noise and delays