I'm not comfortable with ggplot2, and hence I'm not confident with what I'm going to say below.
I think if you use a binwidth argument in geom_bar, then it actually uses geom_histogram. I'm guessing it because of this:
binwidth geom_bar() no longer has a binwidth argument - if you use it you'll get an warning telling to you use geom_histogram() instead.
I hope others with more expertise in ggplot2 will chime in and confirm/discard this claim.
If I use geom_bar() instead, and even if I use 300x300, I do not see this problem.
set.seed(1)
x <- rpois(1e4, 1000) * 2
library(ggplot2)
png(filename = "bar_300_300.png",
width = 300,
height = 300)
ggplot(data.frame(x = x), aes(x)) +
geom_bar()
dev.off()

Edit
Actually, I don't face your problem even with your code. See below:
set.seed(1)
x <- rpois(1e4, 1000) * 2
library(ggplot2)
png("histogram_300_300.png",300,300)
ggplot(data.frame(x = x), aes(x)) +
geom_histogram(binwidth = 1)
dev.off()

(I don't like this plot because of the sudden end, and also because I think it's wrong, but my point is that I don't get those awkward gaps.)